home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / c / ExtrasLib.lha / ExtrasLib / Source / BusyPointer.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  2.2 KB  |  113 lines

  1. #define __USE_SYSBASE
  2. //#include <clib/extras_protos.h>
  3. #include <proto/intuition.h>
  4. #include <proto/exec.h>
  5. #include <exec/memory.h>
  6. #include <intuition/intuition.h>
  7. #include <intuition/intuitionbase.h>
  8.  
  9. /****** extras.lib/Busy ******************************************
  10. *
  11. *   NAME
  12. *       Busy -- displays busy pointer.
  13. *
  14. *   SYNOPSIS
  15. *       Busy(Window)
  16. *
  17. *       void Busy(struct Window *);
  18. *
  19. *   FUNCTION
  20. *       Blocks input to a window by opening a requester.
  21. *
  22. *   INPUTS
  23. *       Window - 
  24. *
  25. *   RESULT
  26. *       None.
  27. *
  28. *   NOTES
  29. *       requires intuition.library to be open.
  30. *
  31. *       This does not change the Window's IDCMP flags, so
  32. *       unless you change them your still going to receive
  33. *       input events.
  34. *       This function does nothing in WB versions less than
  35. *       3.0
  36. *
  37. *   SEE ALSO
  38. *       NotBusy()
  39. *
  40. ******************************************************************************
  41. *
  42. */
  43.  
  44. struct Requester *Busy(struct Window *Win)
  45. {
  46.   struct Requester *req;
  47.   
  48.   if(req=AllocVec(sizeof(struct Requester),MEMF_PUBLIC|MEMF_CLEAR))
  49.   {
  50.     InitRequester(req);
  51.     if(Request(req,Win))
  52.     {
  53.       if(IntuitionBase->LibNode.lib_Version>=39)
  54.       {
  55.         SetWindowPointer(Win,WA_BusyPointer,TRUE,
  56.                              WA_PointerDelay,TRUE,
  57.                              TAG_DONE);
  58.       }
  59.       return(req);
  60.     }
  61.     FreeVec(req);
  62.   }
  63.   return(0);
  64. }
  65.  
  66. /****** extras.lib/NotBusy ******************************************
  67. *
  68. *   NAME
  69. *       NotBusy -- displays busy pointer.
  70. *
  71. *   SYNOPSIS
  72. *       NotBusy(Window)
  73. *
  74. *       void NotBusy(struct Window *);
  75. *
  76. *   FUNCTION
  77. *       Removes the busy pointer for the specified
  78. *       window.
  79. *
  80. *   INPUTS
  81. *       Window - the window to remove the busy pointer
  82. *                from.
  83. *
  84. *   RESULT
  85. *       None.
  86. *
  87. *   NOTES
  88. *       requires intuition.library to be open.
  89. *
  90. *       This does not change the Window's IDCMP flags.
  91. *       This function does nothing in WB versions less than
  92. *       3.0
  93. *
  94. *   SEE ALSO
  95. *       Busy()
  96. *
  97. ******************************************************************************
  98. *
  99. */
  100.  
  101.  
  102. void NotBusy(struct Window *Win, struct Requester *Req)
  103. {
  104.   if(Req && Win)
  105.   {
  106.     if(IntuitionBase->LibNode.lib_Version>=39)
  107.     {
  108.       SetWindowPointer(Win,TAG_DONE);
  109.     }
  110.     EndRequest(Req,Win);
  111.   }
  112. }
  113.